package my.audition;

import java.util.ArrayList;
import java.util.List;


public class TreeNode {
    private String name;
    private String code;
    public List<TreeNode> childTreeNode = new ArrayList<TreeNode>();

    public TreeNode(String name, String code, TreeNode parentNode) {
        this.name = name;
        this.code = code;
        parentNode.addChildTreeNode(this);
    }

    public TreeNode(String name, String code) {
        this.name = name;
        this.code = code;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getCode() {
        return code;
    }

    public void setCode(String code) {
        this.code = code;
    }

    public void addChildTreeNode(TreeNode node) {
        childTreeNode.add(node);
    }
}
